package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum RevenueSettingType {
	
	S_S(0,"商家-商家"),
	S_U(1,"商家-用户"),
	U_S(2,"用户-商家");
	private Integer value;
	
	private String text;

	private RevenueSettingType(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public int toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static RevenueSettingType toType(int value) {
		if (S_S.value == value) {
			return S_S;
		}else if(S_U.value == value){ 
			return S_U;
		}else if(U_S.value == value){ 
			return U_S;
		}else {
			throw new InvalidArgumentException("Unknown RevenueSettingType[" + value + "].");
		}
	}
}
